		if(sessionStorage.user == undefined || JSON.parse(sessionStorage.user).name == null){
			Lg.innerText = '登陆'
			Lg.classList.remove('canend')
		}else{
			Lg.innerText = JSON.parse(sessionStorage.user).name
			Lg.classList.add('canend')
		}
		var req = new XMLHttpRequest()
		function login(){
			if(!id_read.checked){
				alert('请认真阅读相关内容!')
				return
			}
			if(!(uname.value == 'uroot') && (uname.value.slice(0).split(' ').join('') == '' || upwd.value.slice(0).split(' ').join('') == '')){
				upwd_err.style.color = 'red'
				upwd_err.innerText = '请输入用户名或密码'
				upwd_err.style.visibility = 'visible'
			}else{
				req.open('post','http://127.0.0.1:9516/v1/user/login',true)
				req.setRequestHeader('Content-type','application/x-www-form-urlencoded')
				req.send(`uname=${uname.value}&upwd=${upwd.value}`)
				req.onreadystatechange = ()=>{
					if(req.status == 200 && req.readyState == 4){
						// console.log(JSON.parse(req.responseText))
						//location.href='index.html'
						if(JSON.parse(req.responseText).code == 1){
							Lg.innerText = JSON.parse(req.responseText).user
							// sessionStorage.setItem('user',null)
							sessionStorage.setItem('user',JSON.stringify({
								name:JSON.parse(req.responseText).user,
								id:JSON.parse(req.responseText).uid,
							}))
							upwd_err.style.visibility = 'hidden'
							uname.value=upwd.value=''
							function test_1(){
								document.getElementsByClassName('user_login')[0].style.transform = 'rotateY(-90deg)'
								document.getElementsByClassName('user_login')[0].style.opacity = '0'
							}
							confirm('登陆成功')? test_1():test_1();
							Lg.classList.add('canend')
							id_read.checked = false
						}else{
							upwd_err.style.color = 'red'
							upwd_err.innerText = '用户名或密码错误'
							upwd_err.style.visibility = 'visible'
						}
					}
				}
			}
		}
		function regist(){
			if([...document.querySelectorAll('.user_reg>h2+div>input')].every((v)=>v.value.slice(0).split(' ').join('') == '')){
				alert('请填写完整的信息')
			}else if([...document.querySelectorAll('.user_reg>h2+div>span')].every((v)=>v.style.color == 'rgb(0, 200, 0)')){
				req.open('post','http://127.0.0.1:9516/v1/user/reg/creg',true)
				req.setRequestHeader('Content-type','application/x-www-form-urlencoded')
				req.send(`uname=${reg_name.value}&upwd=${reg_pwd.value}&uphone=${reg_phone.value}`)
				req.onreadystatechange = ()=>{
					if(req.status == 200 && req.readyState == 4){
						if(JSON.parse(req.responseText).code == 1){
							alert(JSON.parse(req.responseText).title)
							usershow()
						}else if(JSON.parse(req.responseText).code == 0){
							alert(JSON.parse(req.responseText).title)
						}
					}
				}
			}else{
				alert('请重新核对信息')
			}
		}
		function loginshow(){
			if(!Number(document.getElementsByClassName('user_login')[0].style.opacity)){
				document.getElementById('Lg').style.backgroundColor = '#31a2f7'
				document.getElementById('Lg').style.borderRadius = '19px'
				
				document.getElementsByClassName('user_login')[0].style.transform = 'rotateY(0deg)'
				document.getElementsByClassName('user_login')[0].style.opacity = '1'
				document.getElementsByClassName('user_login')[0].children[0].style.visibility = ''
				document.getElementsByClassName('user_login')[0].children[0].style.transform = ''
				document.getElementsByClassName('user_login')[0].children[0].style.opacity = ''
				
				document.getElementsByClassName('user_reg')[0].style.visibility = ''
				document.getElementsByClassName('user_reg')[0].style.opacity = ''
				document.getElementsByClassName('user_reg')[0].style.transform = ''
				
				document.querySelector('#user>.user_login').style.height = '240px'
			}else{
				document.getElementById('Lg').style.backgroundColor = ''
				document.getElementById('Lg').style.borderRadius = ''
				
				document.getElementsByClassName('user_login')[0].style.transform = ''
				document.getElementsByClassName('user_login')[0].style.opacity = ''
				
				document.getElementsByClassName('user_reg')[0].style.visibility = ''
				document.getElementsByClassName('user_reg')[0].style.opacity = ''
				document.getElementsByClassName('user_reg')[0].style.transform = ''
				
				document.querySelector('#user>.user_login').style.height = '240px'
			}
		}
		function userhidden(){
			document.querySelectorAll('.user_reg>h2+div>span').forEach((v)=>{v.innerText = ''})
			upwd_err.innerText=reg_name.value=reg_pwd.value=reg_repwd.value=reg_phone.value=uname.value=upwd.value=''
			document.getElementsByClassName('user_login')[0].children[0].style.visibility = 'hidden'
			document.getElementsByClassName('user_login')[0].children[0].style.transform = 'rotateY(60deg)'
			document.getElementsByClassName('user_login')[0].children[0].style.opacity = '0'
			
			document.getElementsByClassName('user_reg')[0].style.visibility = 'visible'
			document.getElementsByClassName('user_reg')[0].style.opacity = '1'
			document.getElementsByClassName('user_reg')[0].style.transform = 'rotate(0)'
			
			document.querySelector('#user>.user_login').style.height = '380px'
		}
		function usershow(){
			document.querySelectorAll('.user_reg>h2+div>span').forEach((v)=>{v.innerText = ''})
			upwd_err.innerText=reg_name.value=reg_pwd.value=reg_repwd.value=reg_phone.value=uname.value=upwd.value=''
			document.getElementsByClassName('user_login')[0].children[0].style.visibility = ''
			document.getElementsByClassName('user_login')[0].children[0].style.transform = ''
			document.getElementsByClassName('user_login')[0].children[0].style.opacity = ''
			
			document.getElementsByClassName('user_reg')[0].style.visibility = ''
			document.getElementsByClassName('user_reg')[0].style.opacity = ''
			document.getElementsByClassName('user_reg')[0].style.transform = ''
			
			document.querySelector('#user>.user_login').style.height = '240px'
			
			upwd_err.innerText = ''
		}
		function end(){
			sessionStorage.setItem('user',JSON.stringify({name:null}))
			Lg.classList.remove('canend')
			Lg.innerText = '登陆'
		}
		document.getElementById('reg_name').addEventListener('blur',()=>{
			if(!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(reg_name.value)){
				reg_name.nextElementSibling.style.color = 'rgba(200,0,0)'
				reg_name.nextElementSibling.style.visibility = 'visible'
				reg_name.nextElementSibling.innerText = '请输入合适的用户名'
			}else{
				req.open('post','http://127.0.0.1:9516/v1/user/reg/name',true)
				req.setRequestHeader('Content-type','application/x-www-form-urlencoded')
				req.send(`uname=${reg_name.value}`)
				req.onreadystatechange = ()=>{
					if(req.status == 200 && req.readyState == 4){
						if(JSON.parse(req.responseText).code == 1){
							reg_name.nextElementSibling.style.color = 'rgba(0,200,0)'
							reg_name.nextElementSibling.style.visibility = 'visible'
							reg_name.nextElementSibling.innerText = JSON.parse(req.responseText).title
						}else if(JSON.parse(req.responseText).code == 0){
							reg_name.nextElementSibling.style.color = 'rgba(200,0,0)'
							reg_name.nextElementSibling.style.visibility = 'visible'
							reg_name.nextElementSibling.innerText = JSON.parse(req.responseText).title
						}
					}
				}
			}
		})
		document.getElementById('reg_pwd').addEventListener('blur',()=>{
			if(!/^[a-zA-Z0-9]{4,15}$/.test(reg_pwd.value)){
				reg_pwd.nextElementSibling.style.color = 'rgba(200,0,0)'
				reg_pwd.nextElementSibling.style.visibility = 'visible'
				reg_pwd.nextElementSibling.innerText = '请输入合适的密码'
			}else{
				reg_pwd.nextElementSibling.style.color = 'rgba(0,200,0)'
				reg_pwd.nextElementSibling.style.visibility = 'visible'
				reg_pwd.nextElementSibling.innerText = '密码可用'
			}
			if(reg_repwd.value == reg_pwd.value && reg_repwd.value.slice(0).split(' ').join('')){
				reg_repwd.nextElementSibling.style.color = 'rgba(0,200,0)'
				reg_repwd.nextElementSibling.style.visibility = 'visible'
				reg_repwd.nextElementSibling.innerText = '密码校验成功'
			}else{
				reg_repwd.nextElementSibling.style.color = 'rgba(200,0,0)'
				reg_repwd.nextElementSibling.style.visibility = 'visible'
				reg_repwd.nextElementSibling.innerText = '密码校验失败'
			}
		})
		document.getElementById('reg_repwd').addEventListener('blur',()=>{
			if(reg_repwd.value == reg_pwd.value && reg_repwd.value.slice(0).split(' ').join('')){
				reg_repwd.nextElementSibling.style.color = 'rgba(0,200,0)'
				reg_repwd.nextElementSibling.style.visibility = 'visible'
				reg_repwd.nextElementSibling.innerText = '密码校验成功'
			}else{
				reg_repwd.nextElementSibling.style.color = 'rgba(200,0,0)'
				reg_repwd.nextElementSibling.style.visibility = 'visible'
				reg_repwd.nextElementSibling.innerText = '密码校验失败'
			}
		})
		document.getElementById('reg_phone').addEventListener('blur',()=>{
			if(!/^1[3-9]\d{9}$/.test(reg_phone.value)){
				reg_phone.nextElementSibling.style.color = 'rgba(200,0,0)'
				reg_phone.nextElementSibling.style.visibility = 'visible'
				reg_phone.nextElementSibling.innerText = '请输入合适的手机号'
			}else{
				req.open('post','http://127.0.0.1:9516/v1/user/reg/phone',true)
				req.setRequestHeader('Content-type','application/x-www-form-urlencoded')
				req.send(`uphone=${reg_phone.value}`)
				req.onreadystatechange = ()=>{
					if(req.status == 200 && req.readyState == 4){
						if(JSON.parse(req.responseText).code == 1){
							reg_phone.nextElementSibling.style.color = 'rgba(0,200,0)'
							reg_phone.nextElementSibling.style.visibility = 'visible'
							reg_phone.nextElementSibling.innerText = JSON.parse(req.responseText).title
						}else if(JSON.parse(req.responseText).code == 0){
							reg_phone.nextElementSibling.style.color = 'rgba(200,0,0)'
							reg_phone.nextElementSibling.style.visibility = 'visible'
							reg_phone.nextElementSibling.innerText = JSON.parse(req.responseText).title
						}
					}
				}
			}
		})
		
		function t1(n) {
				for (var i = 0; i < document.getElementsByClassName('top_1')[0].children[0].children.length; i++) {
					document.getElementsByClassName('top_1')[0].children[0].children[i].style.backgroundColor = 'transparent'
				};
				document.getElementsByClassName('top_1')[0].children[0].children[document.getElementsByClassName('top_1')[0].children[0].children.length - n].style.backgroundColor = '#01763a';
		}

		var num_1 = 1;
		function td1() {
			var test_01 = document.getElementsByClassName('td1_n')[0].style,
				test_02 = document.getElementsByClassName('td1_1')[0].style;
			if (num_1) {
				test_01.borderRadius = '10px 10px 0px 0px';
				test_01.backgroundColor = '#01763a';
				test_01.borderColor = '#01763a';
				test_01.color = '#fff';
				test_02.opacity = '1';
				test_02.visibility = 'visible';
				test_02.transform = 'translateY(0)';
				test_02.transition = ' 0.5s 0s all,0s 0s visibility';
				document.styleSheets[0].addRule('#td1_nid::before',
					'border-color:white !important;border-top: 3px solid transparent !important;border-left: 3px solid transparent !important;'
					)
				num_1 = 0
			} else {
				test_01.borderRadius = '10px';
				test_01.backgroundColor = 'transparent';
				test_01.borderColor = '#dedede';
				test_01.color = '#333';
				test_02.opacity = '0';
				test_02.visibility = 'hidden';
				test_02.transform = 'translateY(-10px)';
				test_02.transition = ' 0.5s 0s all,0s 0.5s visibility';
				document.styleSheets[0].addRule('#td1_nid::before',
					'border-color: #01763a !important;border-top: 3px solid transparent !important;border-left: 3px solid transparent !important;'
					)
				num_1 = 1
			}
		}

		var num_2 = 1;
		function td2() {
			var test_01 = document.getElementsByClassName('td2_1')[0].style,
				test_02 = document.getElementsByClassName('one')[0].style;
			if (num_2) {
				num_2 = 0;
				num_3 = 1;
				test_01.opacity = '1';
				test_01.visibility = 'visible';
				test_01.transition = '0.1s 0s all,0s 0s visibility';
				test_02.backgroundImage = 'url(../img/head_sea1.png)';
				document.getElementsByClassName('td3_1')[0].style.visibility = 'hidden'
				document.getElementsByClassName('td3_1')[0].style.opacity = '0'
				document.getElementsByClassName('td3_1')[0].style.transition = '0.1s 0s all,0s 0.1s visibility'
				document.getElementsByClassName('two')[0].style.backgroundImage = 'url(../img/head_share.png)'
			} else {
				num_2 = 1;
				test_01.opacity = '0';
				test_01.visibility = 'hidden';
				test_01.transition = '0.1s 0s all,0s 0.1s visibility';
				test_02.backgroundImage = 'url(../img/head_sea.png)';
			}
		}

		var num_3 = 1;
		function td3() {
			var test_01 = document.getElementsByClassName('td3_1')[0].style,
				test_02 = document.getElementsByClassName('two')[0].style;
			if (num_3) {
				num_3 = 0;
				num_2 = 1;
				test_01.visibility = 'visible';
				test_01.opacity = '1';
				test_01.transition = '0.1s 0s all';
				test_02.backgroundImage = 'url(../img/head_share1.png)';
				document.getElementsByClassName('td2_1')[0].style.opacity = '0';
				document.getElementsByClassName('td2_1')[0].style.visibility = 'hidden';
				document.getElementsByClassName('td2_1')[0].style.transition = '0.1s 0s all,0s 0.1s visibility';
				document.getElementsByClassName('one')[0].style.backgroundImage = 'url(../img/head_sea.png)';
			} else {
				num_3 = 1;
				test_01.visibility = 'hidden';
				test_01.opacity = '0';
				test_01.transition = '0.1s 0s all,0s 0.1s visibility';
				test_02.backgroundImage = 'url(../img/head_share.png)';
			}
		}

		function td5(){
			if(document.getElementsByClassName('on_1')[0]){
				document.querySelector('.on_1').classList.remove('on_1')
			}else{
				document.querySelector('.yx_1>a').classList.add('on_1')
			}
		}
		
		document.querySelector('.test_91').onclick = function(e){
			e.stopPropagation()
		}
		
		window.addEventListener('resize',td7)
		function td7(){
			document.getElementsByClassName('user_login')[0].style.top = `${document.getElementsByClassName('top_1')[0].clientHeight + document.getElementsByClassName('top_2')[0].clientHeight}px`
		}
		td7()